class SystemObject < ActiveRecord::Base
  has_many(:system_method, :dependent => :destroy)
  has_and_belongs_to_many(:user_group)
  has_and_belongs_to_many(:role)

  def self.find_managed
    find(:all, :conditions => ["can_remove is true"], :order => "name")
  end

  def has_system_method?(method_id)
    return false if method_id.nil?
    system_method.each{|method| return true if method.id == method_id}
    return false
  end
end
